<!DOCTYPE html	PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui" xmlns:sdu="http://sduept.com/jsf/cc">
<h:head>
	<link href="/css/primefaces/menubase.css" rel="stylesheet"
		type="text/css" />
	<title>人员选择器</title>
		<style type="text/css">
.value {
	font-weight: bold;
}

.ui-tree {
	width: 400px;
	position: relative;
	height: 500px;
	overflow-y: scroll;
}

input[type="text"] {
	height: 21px;
}
</style>
</h:head>
<h:body>
	<!-- 
使用方法
在页面中
<p:commandButton value="选择执行人" icon="ui-icon-extlink" actionListener="#{flowDesignController.chooseUser()}">
<p:ajax event="dialogReturn"  oncomplete="PF('details').show()" listener="#{flowDesignController.onUsersChosen}" update="details" />
</p:commandButton>
在自己的业务controller中 添加如下方法
public void chooseUser() {
        Map<String,Object> options = new HashMap<String, Object>();
        options.put("resizable", false);
        options.put("draggable", false);
        options.put("modal", true);
        options.put("width", 300);
        options.put("height", 400);
        RequestContext.getCurrentInstance().openDialog("/ui/common/org_selector_user_multiple", options, null);
    }
	public void onUsersChosen(SelectEvent event) {
		//返回的是List<PersonnelEntityBean>
		List<PersonnelEntityBean> users = (List<PersonnelEntityBean>) event.getObject();
	}
 -->
 	<h:form id="opForm">
 		<p:toolbar style="width:380px">
			<f:facet name="left">
				<p:commandButton value="确定" icon="ui-icon-disk"
					 actionListener="#{orgSelectorSingleController.selectedPerson}" />
			</f:facet>
		</p:toolbar>
 	</h:form>
	<h:form id="personForm">
		<!-- 选择操作人 -->
		<p:panel style="height:500px;width:385px;border:0">
			<p:tree value="#{orgSelectorSingleController.deptPerson}" var="node" dynamic="true" selectionMode="single" id="personTree"
				widgetVar="personTree" animate="true" style="border:0;width:380px;">
				<p:ajax event="expand" update=":personForm:personTree"
					listener="#{orgSelectorSingleController.onNodeExpand}" />
				<p:ajax event="select"
					listener="#{orgSelectorSingleController.onPersonNodeSelect}" />
				<p:treeNode type="dept" icon="fa fa-home">
					<h:outputText value="#{node}" />
				</p:treeNode>
				<p:treeNode type="user" icon="fa fa-user">
					<h:outputText value="#{node}" />
				</p:treeNode>
				<p:treeNode type="default" icon="fa fa-home">
					<h:outputText value="#{node}" />
				</p:treeNode>
			</p:tree>
		</p:panel>
	</h:form>
</h:body>
</html>
